<%--
  Created by IntelliJ IDEA.
  User: edz
  Date: 2021/11/10
  Time: 下午5:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>主页</title>
    <script type="text/javascript" src="js/jquery-3.3.1.min(1).js"></script>
    <script>
      $(function () {
        $("#j2f").click(function () {
          var jian = $("#jian").val();
          if (jian == "") {

          } else {
            $.post("/jdbc/translate", {"jianti": jian}, function (data) {
              $("#fan").val(data.fan);
            }, "json")
          }
        })
      })
      $(function () {
        $("#f2j").click(function () {
          var fan = $("#fan").val();
          if (fan =="") {

          } else {
            $.post("/jdbc/translate1", {"fanti": fan}, function (data) {
              $("#jian").val(data.jian)
            }, "json")
          }
        })
      })





    </script>

  </head>
  <body>
  <input type="button" id="j2f"  value="简转繁">
  <input type="button" id="f2j" value="繁转简"> <br>

  <input type="text" id="jian" name="jian">
  <input type="text" id="fan" name="fan">
  </body>
</html>
